package aom.ju.ss.view.dialog

import android.app.Activity
import aom.ju.ss.R
import aom.ju.ss.databinding.CutDialogBinding
import aom.ju.ss.lpInterface.MyHttpCallBack
import aom.ju.ss.utils.LogUtils
import aom.ju.ss.utils.http.LP_API
import aom.ju.ss.utils.http.OKHttpUtils
import aom.ju.ss.utils.show

class CutDialog(activity: Activity, var id: String, var cut_money: String) : BaseDialog(activity) {
    override fun getLay(): Int {
        return R.layout.cut_dialog

    }

    init {
        setWidth(-1)
        val binding = vBinding as CutDialogBinding
        binding.cut.setOnClickListener {
            OKHttpUtils(activity, false)
                .SetApiUrl(LP_API.cut_order_help_cut)
                .SetKey("order_id")
                .SetValue(id)
                .POST(object : MyHttpCallBack {
                    override fun ok(jsonString: String?, httpTY: String?) {
                        CutOkDialog(activity, cut_money)
                        dis()
                    }

                    override fun error(e: String?, jsonString: String?, httpTY: String?) {
                        e?.show
                    }

                })
        }
    }

}